package com.winit.deploy.bean;

import org.springframework.util.StringUtils;

/**
 * Created by wangjian on 16/10/18.
 */
public class WinitInfo {

    public String serverIp;//终端ip
    public String sshPort;//终端ssh端口
    public String userName;//免密登录用户名
    public String keyFilePath;//密钥文件路径

    public String projectName;//要发布的工程名
    public String editionNum;//要发布的版本号
    public String configPath;// OPS/ops.demo.produce.gzidc.area
    public String envName;//非停机发版环境名
    public String areaName;//非停机发版区域名

    public String vmLog;//vm发布时 多输出一份日志
    public boolean vmEnv = false;//是否为vm环境信息
    public String vmRootPass;

    public String queueName;

    public String dstUser;

    public String getQueueName() {
        return queueName;
    }

    public void setQueueName(String queueName) {
        this.queueName = queueName;
    }

    public String getVmLog() {
        return vmLog;
    }

    public void setVmLog(String vmLog) {
        this.vmLog = vmLog;
    }

    public boolean isVmEnv() {
        return vmEnv;
    }

    public void setVmEnv(boolean vmEnv) {
        this.vmEnv = vmEnv;
    }

    public String getVmRootPass() {
        return vmRootPass;
    }

    public void setVmRootPass(String vmRootPass) {
        this.vmRootPass = vmRootPass;
    }

    public String getProjectName() {
        return projectName;
    }

    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }

    public String getEditionNum() {
        return editionNum;
    }

    public void setEditionNum(String editionNum) {
        this.editionNum = editionNum;
    }

    public String getConfigPath() {
        return configPath;
    }

    public void setConfigPath(String configPath) {
        this.configPath = configPath;
    }

    public String getEnvName() {
        return envName;
    }

    public void setEnvName(String envName) {
        this.envName = envName;
    }

    public String getAreaName() {
        return areaName;
    }

    public void setAreaName(String areaName) {
        this.areaName = areaName;
    }

    public String getServerIp() {
        return serverIp;
    }

    public void setServerIp(String serverIp) {
        this.serverIp = serverIp;
    }

    public String getSshPort() {
        return sshPort;
    }

    public void setSshPort(String sshPort) {
        this.sshPort = sshPort;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getKeyFilePath() {
        return keyFilePath;
    }

    public void setKeyFilePath(String keyFilePath) {
        this.keyFilePath = keyFilePath;
    }

    public String getDstUser() {
        if(StringUtils.isEmpty(this.dstUser)){
            return "beetle";
        }
        return dstUser;
    }

    public void setDstUser(String dstUser) {
        this.dstUser = dstUser;
    }
}
